package com.mojo.kafka.interceptor;

import org.apache.kafka.clients.consumer.ConsumerInterceptor;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * 自定义消费者拦截器
 *
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
public class MyConsumerInterceptor implements ConsumerInterceptor {
private static final Logger logger = LoggerFactory.getLogger(MyConsumerInterceptor.class);

    @Override
    public ConsumerRecords onConsume(ConsumerRecords records) {
        logger.info("MyConsumerInterceptor:{}","消费者拦截器");
        return records;
    }

    @Override
    public void close() {

    }

    @Override
    public void onCommit(Map offsets) {

    }

    @Override
    public void configure(Map<String, ?> configs) {

    }
}
